package com.sqx.modules.datacentre.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.entity.UserMoneyDetails;
import com.sqx.modules.errand.entity.Feedback;
import com.sqx.modules.errand.entity.TbIndent;
import com.sqx.modules.order.entity.TbOrder;
import com.sqx.modules.pay.entity.CashOut;
import com.sqx.modules.pay.entity.PayDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

@Mapper
public interface DataCentreDao {

    int findAllCount();

    int findDayAddUser(String format);

    int findMonthAddUser(String format);

    int findYearAddUser(String format);

    BigDecimal findDayIncome(String format);

    BigDecimal findMonthIncome(String format);

    BigDecimal findYearIncome(String format);

    int findIndentCount(String format);

    IPage<TbOrder> selectPayOrderAnalyze(Page<TbOrder> pages, String date, String dateType);

    int sumOrderMonth(Long userId, String date);

    BigDecimal sumTopUpMonth(Long userId, String date);

    BigDecimal selectTopUpStatistics(@Param("date") String date,@Param("dateType") String dateType);

    IPage<UserEntity> findAllCertification(Page<UserEntity> pages, String userName, String phone, String checkCertification);

    int checkCertification(@Param("userId") Long userId, @Param("checkCertification") String checkCertification,@Param("checkCertificationMessage") String checkCertificationMessage);

    UserEntity findCertification(Long userId);

    IPage<TbIndent> rankingList(Page<TbIndent> pages, String address, String date, String dateType);

    int selectNewShopCount(String date, String dateType);

    IPage<TbOrder> selectRankingList(Page<TbOrder> pages, String date, String dateType);

    int allUserCount(String date, String dateType);

    int phoneUserCount(String date, String dateType);

    IPage<Feedback> selectUserFeedback(Page<Feedback> pages, String userEmail);

    IPage<TbIndent> findUserAddIndent(Page<TbIndent> pages, Long userId);

    IPage<TbIndent> findUserReceivingIndent(Page<TbIndent> pages, Long userId);

    IPage<PayDetails> findTopUpMoney(Page<PayDetails> pages, Long userId, String startTime, String endTime);

    IPage<CashOut> findWithdrawMoney(Page<CashOut> pages, Long userId);

    BigDecimal billMoney(String dateType, String date);

    BigDecimal riderMoney(String dateType, String date);

    BigDecimal platformMoney(String dateType, String date);

    IPage<UserMoneyDetails> selectCashDeposit(Page<UserMoneyDetails> pages, String phone, Integer type, Long userId);

    BigDecimal tcwmplatformMoney(String date, String dateType);

    IPage<Feedback> selectFeedbackList(Page<Feedback> pages, Integer type);

    Integer sumJoinOrderMonth(Long userId, String date);

    BigDecimal sumRiderMoney(Long userId);

    BigDecimal sumCashMoney(Long userId, String date);

    int selectTakeCount(Integer orderType,Long shopId, String date, String dateType);

    BigDecimal selectTakeMoney(Integer orderType,Long shopId, String date, String dateType);

    int cancelOrderCount(Long shopId, String date, String dateType);

    BigDecimal cancelOrderMoney(Long shopId, String date, String dateType);

}
